﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <title>行为轨迹</title>
    <link rel="shortcut icon" href="favicon.ico"> 
	<link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="js/plugins/layui/css/layui.css" rel="stylesheet">
    <link href="css/plugins/checkboxes/checkboxes.min.css" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="css/style.min.css?v=4.0.0" rel="stylesheet">
	<style>
		.dl-horizontal dt{width:70px;padding-bottom:10px;line-height:30px;}
		.dl-horizontal dd{margin-left:85px;}
	</style>
</head>

<body>
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox-content">
			    <table id="layTab" class="table table-striped table-bordered table-hover dataTables-example">
					<thead>
						<tr>
							<th>序号</th>
							<th>事件</th>
							<th>请求路径</th>
							<th>请求方式</th>
							<th width="140">请求时间</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
					<tfoot>
					
					</tfoot>
				</table>
				
			</div>
		</div>
	</div>
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.5"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
	<script src="js/plugins/toastr/toastr.min.js"></script>
	<script src="js/plugins/layui/layui.js"></script>
	<script src="js/custom/layTool.js"></script>
    <script type="text/javascript" src="js/custom/app.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/custom/tools.js" charset="UTF-8"></script>
	<script>
	var pageSize = 10;
	var pageNumber = 1;
	function searchUserBehavior(pageNumber ,pageSize){
		var url = 'userBehavior/queryMyBehaviorByPage';
		jQuery.ajax({
			url:domain + url,
			type:"get",
			data:{"page":pageNumber,"pageSize":pageSize},
			crossDomain:true,
			xhrFields:{
				withCredentials:true
			},
			success:function (data) {
				if(data.status == 200){
					var totalPage = data.data.total;//总页数
					pageNumber = data.data.page;//当前页
					var totalRow = data.data.records;//总条数
	   
					//拼凑html
					combHTML(data.data.rows);
				   //分页
					LayPage('layTab',totalPage,totalRow,pageNumber ,pageSize,"searchUserBehavior");
				}else{
					top.toastr.warning(data.msg);
				}
			},
			error:function(data) {
				top.toastr.error("查询列表失败，请检查网络");
			}
		})
		
	}
	
	function combHTML(data){
		var htmls = new Array();
		for (var i=0;i<data.length;i++){
			htmls.push('<tr class="gradeU">');
			htmls.push('		<td>'+ data[i].id +'</td>');
			htmls.push('		<td>'+ data[i].operEvent +'</td>');
			htmls.push('		<td>'+ data[i].reqUrl +'</td>');
			htmls.push('		<td>'+ data[i].reqType +'</td>');
			//htmls.push('		<td>'+ data[i].reqParam +'</td>');
			htmls.push('		<td>'+ data[i].operTime +'</td>');
			htmls.push('</tr>');
							
		}
		$("#layTab tbody").html(htmls.join(''));
		
	}
	
	$(function(){
		searchUserBehavior(pageNumber,pageSize);
	});
	</script>
</body>

</html>
